
import ctypes

SET_RA1 = 1
CLR_RA1 = 2
GET_RA2 = 3
SET_DUTY = 4

usb = ctypes.cdll.LoadLibrary('usb.dll')
usb.initialize()

buffer = ctypes.c_buffer(8)

dev = usb.open_device(0x6666, 0x0003, 0)
if dev<0:
    print "No matching device found...\n"
else:
    ret = usb.control_transfer(dev, 0x00, 0x09, 1, 0, 0, buffer)
    if ret<0:
        print "Unable to send SET_CONFIGURATION standard request.\n"
    usb.close_device(dev)
